package cn.yuanqiao.archive.liyong.domain;

import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;

/**
 * @author zjj
 * @date 2023/9/12
 */
public class TenantDownloadRecord extends BaseEntity {

    private final String BIGTABLENAME = "_DOWNLOAD_RECORD";

    public TenantDownloadRecord() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("TenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    @IdAnnotation
    private Long id;

    private Long docId;

    private Long downloadUserId;

    private Long menuId;

    private Long borrowId;

    private Integer frequency;

    private String tableName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDocId() {
        return docId;
    }

    public void setDocId(Long docId) {
        this.docId = docId;
    }

    public Long getDownloadUserId() {
        return downloadUserId;
    }

    public void setDownloadUserId(Long downloadUserId) {
        this.downloadUserId = downloadUserId;
    }

    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }

    public Long getBorrowId() {
        return borrowId;
    }

    public void setBorrowId(Long borrowId) {
        this.borrowId = borrowId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Integer getFrequency() {
        return frequency;
    }

    public void setFrequency(Integer frequency) {
        this.frequency = frequency;
    }
}
